from tkinter import *

root = Tk()
canvas = Canvas(root, width=400, height=400)
canvas.pack()

item1 = canvas.create_rectangle(10, 10, 100, 100, fill="blue")
item2 = canvas.create_rectangle(50, 50, 150, 150, fill="red")

canvas.tag_raise(item1)  # 使item1位于item2上方

from tkinter import *

root = Tk()
canvas = Canvas(root, width=400, height=400)
canvas.pack()

item1 = canvas.create_rectangle(10, 10, 100, 100, fill="blue")
item2 = canvas.create_rectangle(50, 50, 150, 150, fill="red")

canvas.lift(item1)  # 使item1位于item2上方